Integrand size = 41, antiderivative size = 141 \[ \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {1}{2} \left (a^2 B+2 b^2 B+2 a b (A+2 C)\right ) x+\frac {b^2 C \text {arctanh}(\sin (c+d x))}{d}+\frac {\left (2 A b^2+6 a b B+a^2 (2 A+3 C)\right ) \sin (c+d x)}{3 d}+\frac {a (2 A b+3 a B) \cos (c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d} \]
1/2*(B*a^2+2*B*b^2+2*a*b*(A+2*C))*x+b^2*C*arctanh(sin(d*x+c))/d+1/3*(2*A*b ^2+6*B*a*b+a^2*(2*A+3*C))*sin(d*x+c)/d+1/6*a*(2*A*b+3*B*a)*cos(d*x+c)*sin( d*x+c)/d+1/3*A*cos(d*x+c)^2*(a+b*sec(d*x+c))^2*sin(d*x+c)/d
Time = 1.91 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.11 \[ \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {6 \left (a^2 B+2 b^2 B+2 a b (A+2 C)\right ) (c+d x)-12 b^2 C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 b^2 C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+3 \left (4 A b^2+8 a b B+a^2 (3 A+4 C)\right ) \sin (c+d x)+3 a (2 A b+a B) \sin (2 (c+d x))+a^2 A \sin (3 (c+d x))}{12 d} \]
(6*(a^2*B + 2*b^2*B + 2*a*b*(A + 2*C))*(c + d*x) - 12*b^2*C*Log[Cos[(c + d *x)/2] - Sin[(c + d*x)/2]] + 12*b^2*C*Log[Cos[(c + d*x)/2] + Sin[(c + d*x) /2]] + 3*(4*A*b^2 + 8*a*b*B + a^2*(3*A + 4*C))*Sin[c + d*x] + 3*a*(2*A*b + a*B)*Sin[2*(c + d*x)] + a^2*A*Sin[3*(c + d*x)])/(12*d)
Time = 0.98 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.05, number of steps used = 12, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.293, Rules used = {3042, 4582, 3042, 4562, 25, 3042, 4535, 24, 3042, 4533, 3042, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^3}dx\) |
\(\Big \downarrow \) 4582 |
\(\displaystyle \frac {1}{3} \int \cos ^2(c+d x) (a+b \sec (c+d x)) \left (3 b C \sec ^2(c+d x)+(2 a A+3 b B+3 a C) \sec (c+d x)+2 A b+3 a B\right )dx+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (3 b C \csc \left (c+d x+\frac {\pi }{2}\right )^2+(2 a A+3 b B+3 a C) \csc \left (c+d x+\frac {\pi }{2}\right )+2 A b+3 a B\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )^2}dx+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 4562 |
\(\displaystyle \frac {1}{3} \left (\frac {a (3 a B+2 A b) \sin (c+d x) \cos (c+d x)}{2 d}-\frac {1}{2} \int -\cos (c+d x) \left (6 b^2 C \sec ^2(c+d x)+3 \left (B a^2+2 b (A+2 C) a+2 b^2 B\right ) \sec (c+d x)+2 \left ((2 A+3 C) a^2+6 b B a+2 A b^2\right )\right )dx\right )+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \int \cos (c+d x) \left (6 b^2 C \sec ^2(c+d x)+3 \left (B a^2+2 b (A+2 C) a+2 b^2 B\right ) \sec (c+d x)+2 \left ((2 A+3 C) a^2+6 b B a+2 A b^2\right )\right )dx+\frac {a (3 a B+2 A b) \sin (c+d x) \cos (c+d x)}{2 d}\right )+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \int \frac {6 b^2 C \csc \left (c+d x+\frac {\pi }{2}\right )^2+3 \left (B a^2+2 b (A+2 C) a+2 b^2 B\right ) \csc \left (c+d x+\frac {\pi }{2}\right )+2 \left ((2 A+3 C) a^2+6 b B a+2 A b^2\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {a (3 a B+2 A b) \sin (c+d x) \cos (c+d x)}{2 d}\right )+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 4535 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (\int \cos (c+d x) \left (6 b^2 C \sec ^2(c+d x)+2 \left ((2 A+3 C) a^2+6 b B a+2 A b^2\right )\right )dx+3 \left (a^2 B+2 a b (A+2 C)+2 b^2 B\right ) \int 1dx\right )+\frac {a (3 a B+2 A b) \sin (c+d x) \cos (c+d x)}{2 d}\right )+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (\int \cos (c+d x) \left (6 b^2 C \sec ^2(c+d x)+2 \left ((2 A+3 C) a^2+6 b B a+2 A b^2\right )\right )dx+3 x \left (a^2 B+2 a b (A+2 C)+2 b^2 B\right )\right )+\frac {a (3 a B+2 A b) \sin (c+d x) \cos (c+d x)}{2 d}\right )+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (\int \frac {6 b^2 C \csc \left (c+d x+\frac {\pi }{2}\right )^2+2 \left ((2 A+3 C) a^2+6 b B a+2 A b^2\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx+3 x \left (a^2 B+2 a b (A+2 C)+2 b^2 B\right )\right )+\frac {a (3 a B+2 A b) \sin (c+d x) \cos (c+d x)}{2 d}\right )+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 4533 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (6 b^2 C \int \sec (c+d x)dx+\frac {2 \sin (c+d x) \left (a^2 (2 A+3 C)+6 a b B+2 A b^2\right )}{d}+3 x \left (a^2 B+2 a b (A+2 C)+2 b^2 B\right )\right )+\frac {a (3 a B+2 A b) \sin (c+d x) \cos (c+d x)}{2 d}\right )+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (6 b^2 C \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {2 \sin (c+d x) \left (a^2 (2 A+3 C)+6 a b B+2 A b^2\right )}{d}+3 x \left (a^2 B+2 a b (A+2 C)+2 b^2 B\right )\right )+\frac {a (3 a B+2 A b) \sin (c+d x) \cos (c+d x)}{2 d}\right )+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \left (\frac {2 \sin (c+d x) \left (a^2 (2 A+3 C)+6 a b B+2 A b^2\right )}{d}+3 x \left (a^2 B+2 a b (A+2 C)+2 b^2 B\right )+\frac {6 b^2 C \text {arctanh}(\sin (c+d x))}{d}\right )+\frac {a (3 a B+2 A b) \sin (c+d x) \cos (c+d x)}{2 d}\right )+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}\) |
(A*Cos[c + d*x]^2*(a + b*Sec[c + d*x])^2*Sin[c + d*x])/(3*d) + ((a*(2*A*b + 3*a*B)*Cos[c + d*x]*Sin[c + d*x])/(2*d) + (3*(a^2*B + 2*b^2*B + 2*a*b*(A + 2*C))*x + (6*b^2*C*ArcTanh[Sin[c + d*x]])/d + (2*(2*A*b^2 + 6*a*b*B + a ^2*(2*A + 3*C))*Sin[c + d*x])/d)/2)/3
3.9.75.3.1 Defintions of rubi rules used
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[A*Cot[e + f*x]*((b*Csc[e + f*x])^m/(f*m)), x] + Simp[(C*m + A*(m + 1))/(b^2*m) Int[(b*Csc[e + f*x])^(m + 2), x], x] /; Fr eeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]* (B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.)), x_Symbol] :> Simp[B/b Int[(b*Cs c[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x]^2) , x] /; FreeQ[{b, e, f, A, B, C, m}, x]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a _)), x_Symbol] :> Simp[A*a*Cot[e + f*x]*((d*Csc[e + f*x])^n/(f*n)), x] + Si mp[1/(d*n) Int[(d*Csc[e + f*x])^(n + 1)*Simp[n*(B*a + A*b) + (n*(a*C + B* b) + A*a*(n + 1))*Csc[e + f*x] + b*C*n*Csc[e + f*x]^2, x], x], x] /; FreeQ[ {a, b, d, e, f, A, B, C}, x] && LtQ[n, -1]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a _))^(m_), x_Symbol] :> Simp[A*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Csc[e + f*x])^n/(f*n)), x] - Simp[1/(d*n) Int[(a + b*Csc[e + f*x])^(m - 1)*(d* Csc[e + f*x])^(n + 1)*Simp[A*b*m - a*B*n - (b*B*n + a*(C*n + A*(n + 1)))*Cs c[e + f*x] - b*(C*n + A*(m + n + 1))*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a , b, d, e, f, A, B, C}, x] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && LeQ[n, -1]
Time = 0.52 (sec) , antiderivative size = 133, normalized size of antiderivative = 0.94
method | result | size |
parallelrisch | \(\frac {-12 C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) b^{2}+12 C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) b^{2}+\left (6 a A b +3 B \,a^{2}\right ) \sin \left (2 d x +2 c \right )+a^{2} A \sin \left (3 d x +3 c \right )+\left (\left (9 A +12 C \right ) a^{2}+24 B a b +12 A \,b^{2}\right ) \sin \left (d x +c \right )+12 d x \left (\frac {B \,a^{2}}{2}+a b \left (A +2 C \right )+B \,b^{2}\right )}{12 d}\) | \(133\) |
derivativedivides | \(\frac {\frac {a^{2} A \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+B \,a^{2} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \,a^{2} \sin \left (d x +c \right )+2 a A b \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 B a b \sin \left (d x +c \right )+2 C a b \left (d x +c \right )+A \,b^{2} \sin \left (d x +c \right )+B \,b^{2} \left (d x +c \right )+C \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(154\) |
default | \(\frac {\frac {a^{2} A \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}+B \,a^{2} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \,a^{2} \sin \left (d x +c \right )+2 a A b \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 B a b \sin \left (d x +c \right )+2 C a b \left (d x +c \right )+A \,b^{2} \sin \left (d x +c \right )+B \,b^{2} \left (d x +c \right )+C \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(154\) |
risch | \(a A b x +\frac {a^{2} B x}{2}+x B \,b^{2}+2 x C a b +\frac {3 i a^{2} A \,{\mathrm e}^{-i \left (d x +c \right )}}{8 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B a b}{d}-\frac {3 i a^{2} A \,{\mathrm e}^{i \left (d x +c \right )}}{8 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} C \,a^{2}}{2 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} A \,b^{2}}{2 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} B a b}{d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} A \,b^{2}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} C \,a^{2}}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C \,b^{2}}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C \,b^{2}}{d}+\frac {a^{2} A \sin \left (3 d x +3 c \right )}{12 d}+\frac {\sin \left (2 d x +2 c \right ) a A b}{2 d}+\frac {\sin \left (2 d x +2 c \right ) B \,a^{2}}{4 d}\) | \(272\) |
norman | \(\frac {\left (-a A b -\frac {1}{2} B \,a^{2}-B \,b^{2}-2 C a b \right ) x +\left (-3 a A b -\frac {3}{2} B \,a^{2}-3 B \,b^{2}-6 C a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (a A b +\frac {1}{2} B \,a^{2}+B \,b^{2}+2 C a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+\left (3 a A b +\frac {3}{2} B \,a^{2}+3 B \,b^{2}+6 C a b \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {\left (2 a^{2} A -2 a A b +2 A \,b^{2}-B \,a^{2}+4 B a b +2 C \,a^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{d}+\frac {2 \left (2 a^{2} A -2 a A b -2 A \,b^{2}-B \,a^{2}-4 B a b -2 C \,a^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {2 \left (2 a^{2} A +2 a A b -2 A \,b^{2}+B \,a^{2}-4 B a b -2 C \,a^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {\left (2 a^{2} A +2 a A b +2 A \,b^{2}+B \,a^{2}+4 B a b +2 C \,a^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (14 a^{2} A -18 a A b +6 A \,b^{2}-9 B \,a^{2}+12 B a b +6 C \,a^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{3 d}+\frac {\left (14 a^{2} A +18 a A b +6 A \,b^{2}+9 B \,a^{2}+12 B a b +6 C \,a^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{3}}+\frac {C \,b^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {C \,b^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(507\) |
1/12*(-12*C*ln(tan(1/2*d*x+1/2*c)-1)*b^2+12*C*ln(tan(1/2*d*x+1/2*c)+1)*b^2 +(6*A*a*b+3*B*a^2)*sin(2*d*x+2*c)+a^2*A*sin(3*d*x+3*c)+((9*A+12*C)*a^2+24* B*a*b+12*A*b^2)*sin(d*x+c)+12*d*x*(1/2*B*a^2+a*b*(A+2*C)+B*b^2))/d
Time = 0.30 (sec) , antiderivative size = 127, normalized size of antiderivative = 0.90 \[ \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {3 \, C b^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, C b^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left (B a^{2} + 2 \, {\left (A + 2 \, C\right )} a b + 2 \, B b^{2}\right )} d x + {\left (2 \, A a^{2} \cos \left (d x + c\right )^{2} + 2 \, {\left (2 \, A + 3 \, C\right )} a^{2} + 12 \, B a b + 6 \, A b^{2} + 3 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \]
integrate(cos(d*x+c)^3*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)+C*sec(d*x+c)^2), x, algorithm="fricas")
1/6*(3*C*b^2*log(sin(d*x + c) + 1) - 3*C*b^2*log(-sin(d*x + c) + 1) + 3*(B *a^2 + 2*(A + 2*C)*a*b + 2*B*b^2)*d*x + (2*A*a^2*cos(d*x + c)^2 + 2*(2*A + 3*C)*a^2 + 12*B*a*b + 6*A*b^2 + 3*(B*a^2 + 2*A*a*b)*cos(d*x + c))*sin(d*x + c))/d
\[ \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos ^{3}{\left (c + d x \right )}\, dx \]
Integral((a + b*sec(c + d*x))**2*(A + B*sec(c + d*x) + C*sec(c + d*x)**2)* cos(c + d*x)**3, x)
Time = 0.22 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.11 \[ \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=-\frac {4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a^{2} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} - 6 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a b - 24 \, {\left (d x + c\right )} C a b - 12 \, {\left (d x + c\right )} B b^{2} - 6 \, C b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, C a^{2} \sin \left (d x + c\right ) - 24 \, B a b \sin \left (d x + c\right ) - 12 \, A b^{2} \sin \left (d x + c\right )}{12 \, d} \]
integrate(cos(d*x+c)^3*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)+C*sec(d*x+c)^2), x, algorithm="maxima")
-1/12*(4*(sin(d*x + c)^3 - 3*sin(d*x + c))*A*a^2 - 3*(2*d*x + 2*c + sin(2* d*x + 2*c))*B*a^2 - 6*(2*d*x + 2*c + sin(2*d*x + 2*c))*A*a*b - 24*(d*x + c )*C*a*b - 12*(d*x + c)*B*b^2 - 6*C*b^2*(log(sin(d*x + c) + 1) - log(sin(d* x + c) - 1)) - 12*C*a^2*sin(d*x + c) - 24*B*a*b*sin(d*x + c) - 12*A*b^2*si n(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 346 vs. \(2 (133) = 266\).
Time = 0.31 (sec) , antiderivative size = 346, normalized size of antiderivative = 2.45 \[ \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {6 \, C b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 6 \, C b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + 3 \, {\left (B a^{2} + 2 \, A a b + 4 \, C a b + 2 \, B b^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (6 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \]
integrate(cos(d*x+c)^3*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)+C*sec(d*x+c)^2), x, algorithm="giac")
1/6*(6*C*b^2*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 6*C*b^2*log(abs(tan(1/2* d*x + 1/2*c) - 1)) + 3*(B*a^2 + 2*A*a*b + 4*C*a*b + 2*B*b^2)*(d*x + c) + 2 *(6*A*a^2*tan(1/2*d*x + 1/2*c)^5 - 3*B*a^2*tan(1/2*d*x + 1/2*c)^5 + 6*C*a^ 2*tan(1/2*d*x + 1/2*c)^5 - 6*A*a*b*tan(1/2*d*x + 1/2*c)^5 + 12*B*a*b*tan(1 /2*d*x + 1/2*c)^5 + 6*A*b^2*tan(1/2*d*x + 1/2*c)^5 + 4*A*a^2*tan(1/2*d*x + 1/2*c)^3 + 12*C*a^2*tan(1/2*d*x + 1/2*c)^3 + 24*B*a*b*tan(1/2*d*x + 1/2*c )^3 + 12*A*b^2*tan(1/2*d*x + 1/2*c)^3 + 6*A*a^2*tan(1/2*d*x + 1/2*c) + 3*B *a^2*tan(1/2*d*x + 1/2*c) + 6*C*a^2*tan(1/2*d*x + 1/2*c) + 6*A*a*b*tan(1/2 *d*x + 1/2*c) + 12*B*a*b*tan(1/2*d*x + 1/2*c) + 6*A*b^2*tan(1/2*d*x + 1/2* c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^3)/d
Time = 16.90 (sec) , antiderivative size = 263, normalized size of antiderivative = 1.87 \[ \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {3\,A\,a^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {A\,b^2\,\sin \left (c+d\,x\right )}{d}+\frac {C\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,C\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {2\,B\,a\,b\,\sin \left (c+d\,x\right )}{d}+\frac {2\,A\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,C\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2\,d} \]
(3*A*a^2*sin(c + d*x))/(4*d) + (A*b^2*sin(c + d*x))/d + (C*a^2*sin(c + d*x ))/d + (B*a^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*B*b^2*at an(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*C*b^2*atanh(sin(c/2 + (d *x)/2)/cos(c/2 + (d*x)/2)))/d + (A*a^2*sin(3*c + 3*d*x))/(12*d) + (B*a^2*s in(2*c + 2*d*x))/(4*d) + (2*B*a*b*sin(c + d*x))/d + (2*A*a*b*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (4*C*a*b*atan(sin(c/2 + (d*x)/2)/cos(c /2 + (d*x)/2)))/d + (A*a*b*sin(2*c + 2*d*x))/(2*d)